#pragma once
#ifndef ADD_SUB_EXPR
#define ADD_SUB_EXPR

#include <stdio.h>
#include <string.h>
#include "util.h"
static const int EXPR_LEN = 16;
static const int BOUND = 20;

class AddSubExpr {
public:
    void showExpr() const { printf("%s", expr); }
    void inptAns() { usrAns = getNum(); }
    bool isCorrect() const { return stdAns == usrAns; }
    int getUsrAns() const { return usrAns; }

    bool operator==(const AddSubExpr& other) const { return !strcmp(expr, other.expr); }
    bool operator!=(const AddSubExpr& other) const { return !(*this == other); }
    bool operator<(const AddSubExpr& other) const { return strcmp(expr, other.expr) < 0; }
    bool operator>(const AddSubExpr& other) const { return strcmp(expr, other.expr) > 0; }

protected:
    char expr[EXPR_LEN];
    int stdAns;

private:
    int usrAns;
};

#endif // !ADD_SUB_EXPR